package com.barry.excel;

import com.barry.ExcelGenerator;
import com.barry.bean.OperationData;
import com.barry.bean.ReportTypeEnum;
import com.barry.dto.ReportConfig;
import com.barry.generator.ExcelReportAction;

import java.util.List;

/**
 * @ClassName OperationData
 * @Description
 * @Author wangxuexing
 * @Date 2020/2/21 14:56
 * @Version 1.0
 */
public class OperationReportGenerator extends ExcelReportAction {
    @Override
    public void preCheck() {}

    @Override
    public ReportConfig setReportConfig() {
        return new ReportConfig(ReportTypeEnum.SUPPLIER_OPERATION,
                "operation_data.xlsx",
                "经营数据");
    }

    /**
     * 获取所有查询记录条数
     * @return
     */
    @Override
    public int allRecordsCount(){
        return 1000000;
    }

    @Override
    public List<OperationData> getReportDataByPage(int currentPage, int pageSize, int count) {
        System.out.println("-------------------getReportDataByPage:currentPage="+currentPage+" pageSize="+pageSize+" count="+count);
        return ExcelGenerator.genDataList(currentPage, pageSize, count);
    }

    public static void main(String[] args) {
        OperationReportGenerator gen = new OperationReportGenerator();
        gen.execute();
    }
}
